#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2018/11/15 22:03
# @Author  : Virace
# @File    : permission.py
# @Software: PyCharm

from rest_framework.permissions import BasePermission


class SimplePermission(BasePermission):
    """
    简单用户权限验证
    """

    message = ''

    def has_permission(self, request, view):
        if request.user.usertype == 3:
            return True

    def has_object_permission(self, request, view, obj):
        """
        Return `True` if permission is granted, `False` otherwise.
        """
        return True

